package jastgen.generator;

import static jastgen.generator.Helper.*;
import java.io.PrintWriter;
import jastgen.CompileException;
import jastgen.nodes.ClassDef;
import jastgen.nodes.Module;

class VoidVisitorBodyGenerator implements BodyGenerator {

	private final Module node;

	VoidVisitorBodyGenerator(
			final Module node
		) throws CompileException {

		this.node = node;
	}

	public void generate(
			final PrintWriter out)
	{
		generateVisitorBody(out, node);
	}

	private void generateVisitorBody(
			final PrintWriter out,
			final Module node)
	{
		out.println("public interface VoidVisitor {");
		out.println();

		for(final ClassDef i : node.getClassDefs()) {
			printVisitI(out, i, "void");
		}

		out.println("}");
	}
}
